/////////////////////////////////////////////     File     //////////////////////////////////////////////////
// Author: James Chen
// Filename: Camera.h
// Created: Saturday, August 14, 2010 9:55:35 AM
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "CUtilities.h"

/////////////////////////////////////////////     Class     /////////////////////////////////////////////////
// Name: CCamera
// Author: James Chen
// Created: Saturday, August 14, 2010 9:55:35 AM
//
// Purpose: Camera class
//
// Revisions: 
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
class CCamera
{
	////////////////////// Singleton Implementation Begins //////////////////////
private:

	CCamera(void);
	CCamera(const CCamera&);
	CCamera& operator =(const CCamera&);
	static CCamera *m_pInstance;

	CDXInput *Input;

	D3DXVECTOR3 m_vecPosition;

	D3DXVECTOR3 m_vecMousePosition;
	D3DXVECTOR3 m_vecLastMousePosition;
	D3DXVECTOR3 m_vecDeltaMousePosition;

	D3DXVECTOR3 m_vecRight;
	D3DXVECTOR3 m_vecUp;
	D3DXVECTOR3 m_vecLookAt;

	float ZoomScale;

	int ZAxisLocation;
	int ZAxisLocationOld;

	// NEW STUFF //
	D3DXQUATERNION	m_quatOrientation;

	D3DXVECTOR3		m_vectPosition;
	D3DXVECTOR3		m_vectCamOffset;

	float			m_fSlerpSpeed;
	float			m_fSpeed;
	float			m_fRPM;

	bool			m_bUpdateNeeded;

public:

	D3DXMATRIX m_matView;

	D3DXVECTOR3 m_vecTarget;

	float mRadius;
	float mTheta;
	float mPhi;

	virtual ~CCamera(void);
	static CCamera *GetInstance(void);
	static void DeleteInstance(void);
	/////////////////////// Singleton Implementation Ends ///////////////////////

	void CameraMovement(float deltaTime);
	D3DXMATRIX Update(float deltaTime);
	void AutoSetScale(void);

	D3DXVECTOR3 GetRightVector();
	D3DXVECTOR3 GetUpVector();
	D3DXVECTOR3 GetLookAtVector();

	// NEW STUFF //

	const D3DXQUATERNION GetRotation() const { return m_quatOrientation; }


};